from django.db import models
from dingxiang.utils.models import BaseModel

# 科普视频
class SciencePopularization(BaseModel):
    title = models.CharField(max_length=255, verbose_name="标题")
    cover_image = models.ImageField(upload_to='science_popularization/', null=True, blank=True, verbose_name="视频封面图片")
    video_url = models.URLField(max_length=255, verbose_name="视频链接")
    length = models.CharField(max_length=100, verbose_name="视频长度")
    subtitle_languages = models.CharField(max_length=100, verbose_name="字幕语言")
    copyright = models.CharField(max_length=255, blank=True, null=True, verbose_name="版权信息")
    
    def __str__(self):
        return self.title  # 返回标题作为字符串表示

    class Meta:
        db_table = 'science_popularization'
        verbose_name_plural = '科普视频'